package com.mingle.iwalk;

import java.util.ArrayList;
import java.util.HashMap;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class SoftwareInfoActivity extends Activity {

	 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.sw_info_layout);
        
        Button exitBtn = (Button) findViewById(R.id.exit_btn);
        exitBtn.setOnClickListener(mExitListener);
        
        ListView settingsList = (ListView) findViewById(R.id.settings_list);
        ArrayList<HashMap<String, Object>> al = new ArrayList<HashMap<String, Object>>(); 

        Resources res = getContext().getResources();
        HashMap<String,Object> hm =new HashMap<String,Object>();
        hm.put("pri", res.getString(R.string.sw_version));
        hm.put("sub", res.getString(R.string.sw_version_no));
        al.add(hm);
        
        HashMap<String,Object> hm2 =new HashMap<String,Object>();
        hm2.put("pri", res.getString(R.string.sw_copyright));
        hm2.put("sub", res.getString(R.string.sw_designer));
        al.add(hm2);

        SimpleAdapter adapter = new SimpleAdapter(this,al,R.layout.settings_list_item,new String[]{"pri","sub"},new int[]{R.id.settings_list_item_pri,R.id.settings_list_item_sub});
        settingsList.setAdapter(adapter);
        //settingsList.setEnabled(false);
       
    }
    
	private OnClickListener mExitListener = new OnClickListener()
	{

		@Override
		public void onClick(View v) {
			finish();
		}
		
	};
	
	private Context getContext()
    {
    	return SoftwareInfoActivity.this;
    }
}
